-
Notifications
You must be signed in to change notification settings - Fork 29
Rework: Dataset Settings #8732
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: functional_dataset_settings
Are you sure you want to change the base?
Rework: Dataset Settings #8732
Conversation
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
…s/webknossos into dataset_settings_context
This PR updates React Router (RR) from v5 to v6 following their [upgrade guide](https://reactrouter.com/6.30.1/upgrading/v5). There is already react-router v7 but let's go step by step. v7 also seems to have the same API as v6 so we might update soon in a follow up PR (and double check compatibility with React v18/19). Noteworthy changes and high level concepts: - RR v6 offer various ways of setting up a router ([Docs](https://reactrouter.com/6.30.1/routers/picking-a-router)): - Declarative: Using JSX `<Route`> elements like we did so far - Data API: Create routes as TS code. This is the recommend method and what I used for the refactor. - Ideally the routes are constant and live outside a react component to avoid constant recreation of the router/routes - While you are meant to define routes as code, there is a "bridge"/helper, [`createRoutesFromElements`]( https://reactrouter.com/6.30.1/utils/create-routes-from-elements), that translates JSX `<Route>` objects into code. I used that to keep the diff and changes somewhat manageable. We can switch to a purely code based definition in the future. - File-Base/Framework: You can define routes through your hierarchy on the file system. (not used) - RR v6 `<Routes>` do not have a `render={() => ...}` prop anymore that would run any function. That makes it impossible to do any sort of conditional logic inside the router. I moved all these methods into new React wrapper components. - RR v6 uses new hooks: `useNavigation`, `useParams`(for accessing route parameters, e.g. `/tasks/:taskId`) - RR v6 allows [nested routing](https://reactrouter.com/6.30.1/start/overview#nested-routes). A common parent page (with nice layout) can be used to render/insert the child views with an `<Outlet />` component. I used it for the orga & account pages for rendering the various tabs into a comment parent. Also, the router's root element uses an `<Outlet>`. - RR v6 does not support class-based React component anymore. The `withRouter` HOC was removed. I build a new `withRouter` HOC as a workaround for our remaining React class components. - RR v6 removed an imperative API for blocking the navigation from one page to another. It was replace with a hook [`useBlocker`](https://reactrouter.com/6.30.1/hooks/use-blocker). Unfortunately, we mostly use the blocker in class based components. There is not easy workaround - so I had to remove some of the blocking stuff. (Dataset Setting are currently being refactored as functional components and will be able to use that once more. #8732 ) ### URL of deployed dev instance (used for testing): - https://___.webknossos.xyz ### Steps to test: My testing process: - Click through all the routes/views and make sure they still work - Make sure that routes with parameters still work, e.g. all the task, projects, task types stuff with ids and prefilled forms - Test a legacy route ### TODOs: - [x] Fix: navigation blockers - [ ] Decide: Should we rename the `SecuredRoute` component? It is not a `<Route>` any more... maybe `AuthRequired` or `RequireAuth` or something. - [x] Fix: `features` type definition. It needs too load earlier. - [x] Fix: dashboard header having too many items <img width="1650" alt="Screenshot 2025-07-03 at 09 37 11" src="https://github.com/user-attachments/assets/9bba76e3-2b3a-4bad-8be0-798685d0e4ac" /> ### Issues: - fixes # ------ (Please delete unneeded items, merge only when none are left open) - [x] Added changelog entry (create a `$PR_NUMBER.md` file in `unreleased_changes` or use `./tools/create-changelog-entry.py`) - [ ] Added migration guide entry if applicable (edit the same file as for the changelog) - [ ] Updated [documentation](../blob/master/docs) if applicable - [ ] Adapted [wk-libs python client](https://github.com/scalableminds/webknossos-libs/tree/master/webknossos/webknossos/client) if relevant API parts change - [ ] Removed dev-only changes like prints and application.conf edits - [ ] Considered [common edge cases](../blob/master/.github/common_edge_cases.md) - [ ] Needs datastore update after deployment --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Michael Büßemeyer <39529669+MichaelBuessemeyer@users.noreply.github.com>
This PR reworks the appearance of the dataset settings to be similar to the account & orga settings pages.
SettingsCard
URL of deployed dev instance (used for testing):
Issues:
(Please delete unneeded items, merge only when none are left open)
$PR_NUMBER.md
file inunreleased_changes
or use./tools/create-changelog-entry.py
)